function clickWrap(){
	
	var first = $("#frist").attr("src").indexOf("over");
	var second = $("#second").attr("src").indexOf("over");
	if(first==-1 || second==-1){
		alert("모두 동의해 주십시오.");
		return;
	}else{
		var customForm  = document.createElement("form"); 
	    var customInput = document.createElement("input");
	    
	    customInput.setAttribute('name','checkValue'); 
	    customInput.setAttribute('value','1'); 
	    customForm.appendChild(customInput); 
        document.body.appendChild(customForm);
	    
        customForm.method='post';
        customForm.action='infoInput.do';
        customForm.submit();
	}
}


function infoInput(){
	var name_frist = $(".clickWrap_infoInput_name").children("input").eq(0).val();
	var name_second = $(".clickWrap_infoInput_name").children("input").eq(1).val();
	var sendToName =  name_frist+name_second;
	
	var email_frist = $(".clickWrap_infoInput_email").children("input").eq(0).val();
	var email_second = $(".clickWrap_infoInput_email").children("input").eq(1).val();
	var sendToEmail = email_frist+"@"+email_second;
	
	var passWord = $(".clickWrap_infoInput_pw").children("input").val();
	var passWord_second = $(".clickWrap_infoInput_pw_repeat").children("input").val();
	
	var customForm  = document.createElement("form"); 
    var customId = document.createElement("input");
    var customPw = document.createElement("input");
    var customEmail = document.createElement("input");
    
    customId.setAttribute('name','user_name'); 
    customId.setAttribute('value',sendToName); 
    customForm.appendChild(customId); 
    
    
    customPw.setAttribute('name','user_pw'); 
    customPw.setAttribute('value',passWord); 
    customForm.appendChild(customPw); 
    
    
    customEmail.setAttribute('name','user_email'); 
    customEmail.setAttribute('value',sendToEmail); 
    customForm.appendChild(customEmail); 
    
    
    document.body.appendChild(customForm);
    
    customForm.method='post';
    customForm.action='joinUserConfirm.do';
    customForm.submit();
    
}

function joinUser(){
	var user_name = $("#user_name").val();
	var user_pw = $("#user_pw").val();
	var user_email = $("#user_email").val();
	
	jQuery.ajax({
		type:"POST",
		url:"/server/chat_grab/member_insert",
		data:{
			name : user_name,
			email : user_email,
			password : user_pw
		},
		dataType:"json",
		success : function(result) {
			if(result.resultCode==-1){
				alert("실패");
			}else if(result.resultCode==0){
				location.href="joinUserComplete.do";
			}else{
				alert("알수없는오류");
			}
		}
	});
	
	
}


function loginUser(){
	var user_email = $("#user_id").val();
	var user_pw = $("#user_pw").val();
	
	jQuery.ajax({
		type:"POST",
		url:"/server/chat_grab/login_proc.do",
		data:{
			email : user_email,
			password : user_pw
		},
		dataType:"json",
		success : function(result) {
			if(result.resultCode==-1){
				$(".login_fail_msg").css("visibility","visible");
			}else{
				location.href="list.do";
			}
		}
	});
	
	
}


/*jQuery.ajax({
	type:"POST",
	url:"/web/admin/view/account",
	data:{
		page : num
	},
	dataType:"json",
	success : function(result) {
		$.each(result.account_list, function(key, value) {
			
		});
	}
});
*/